{include file="public/_head"}
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

        <!-- Page Sidebar -->
        {include file="public/_left" /}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li class="active">
                        <i class="fa fa-home"></i>&nbsp;管理员管理
                    </li>
                    <li>
                        管理员密码编辑
                    </li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Body -->
            <div class="page-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget radius-bordered">
                            <div class="widget-header bordered-bottom bordered-themeprimary">
                                <span class="widget-caption">管理员密码编辑</span>
                            </div>
                            <div class="widget-body">
                                <form class="form-horizontal">
                                    <div class="form-group">
                                        <label for="account" class="col-sm-2 control-label no-padding-right">账号：</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="account" name="account" value="{$admin.account}" readonly="readonly" />
                                            <input type="hidden" name="a_id" value="{$admin.id}" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="oldpassword" class="col-sm-2 control-label no-padding-right">原密码：</label>
                                        <div class="col-sm-6">
                                            <input type="password" class="form-control" id="oldpassword" name="oldpassword" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="newpassword" class="col-sm-2 control-label no-padding-right">新密码：</label>
                                        <div class="col-sm-6">
                                            <input type="password" class="form-control" id="newpassword" name="npassword" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="qpassword" class="col-sm-2 control-label no-padding-right">确认密码：</label>
                                        <div class="col-sm-6">
                                            <input type="password" class="form-control" id="qpassword" name="qpassword" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <button type="submit" class="btn btn-primary">更新</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->

    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

</div>

{include file='public/_js' /}
<script>
    $(function (){
        $('.btn-primary').click(function () {
            $.ajax({
                url:"{:url('admin/admin/admin_pass')}",
                type:'post',
                data:$('form').serialize(),
                dataType:'json',
                success:function (data) {
                    if (data.code == 1){
                        layer.msg(data.msg,{
                            icon:6,
                            time:1000
                        },function () {
                            location.href = data.url;
                        });
                    } else {
                        layer.open({
                            title:'管理员密码编辑',
                            content:data.msg,
                            icon:5,
                            anim:6
                        });
                    }
                }
            });
            return false;
        });
    });
</script>

</body>
<!--  /Body -->
</html>
